//
//  PlaceDetailViewController.m
//  Conference
//
//  Created by Xiang He on 12-11-19.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import "PlaceDetailViewController.h"
#import "Globals.h"
@interface PlaceDetailViewController ()

@end

@implementation PlaceDetailViewController
@synthesize lab_title;
@synthesize lab_time;
@synthesize lab_content;
@synthesize placeData;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    NSString *content=[NSString stringWithFormat:@"      %@",self.placeData.message];
    
    UIFont *font = [UIFont systemFontOfSize:16];
    
    CGSize size=[[Globals getInstance]CalculationCellSize:self.view.frame.size.width fontSize:16 content:content];
    
    CGRect rect = [self.lab_content textRectForBounds:self.lab_content.frame limitedToNumberOfLines:0];
    rect.size=size;
    self.lab_content.frame = rect;
    self.lab_content.text=content;
    self.lab_content.numberOfLines = 0;
    self.lab_content.font = font;
    
    self.lab_title.text=self.placeData.title;
    self.lab_time.text=[NSString stringWithFormat:@"更新时间:%@",self.placeData.dateTime];;
   
    if(![@"" isEqualToString:self.placeData.urlPhoto]){
    }
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}

- (void)viewDidUnload
{
    [self setLab_title:nil];
    [self setLab_time:nil];
    [self setLab_content:nil];
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

- (void)dealloc {
    [lab_title release];
    [lab_time release];
    [lab_content release];
    [super dealloc];
}
@end
